package com.teziyou.commodity.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;

public class Area extends Model<Area> {

	/**
	 * 
	 */
	private static final long serialVersionUID = -425472804276301212L;
	
	public static final Area dao = new Area();
	
	public List<Area> getAreasByPid(int pid) {
		return dao.find("select * from administrativedivision where ParentDivisionID = ?", pid);
	}
	
	public List<Area> getSameLevelAreas(int id) {
		return dao.find("select * from administrativedivision where ParentDivisionID = "
				+ "(select ParentDivisionID from administrativedivision where adm_div_id = ?) ", id);
	}

}
